package com.shr.exam.zhxyk;

import java.util.Scanner;

public class Main1 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num1 = sc.nextInt();
		int num2 = sc.nextInt();
		int threhold = sc.nextInt();
		
		int minBei = getMinBei(num1, num2);
		System.out.println(threhold / minBei);
		sc.close();
	}

	private static int getMinBei(int num1, int num2) {
		int yue = getYue(num1, num2);
		return num1 * num2 / yue;
	}

	private static int getYue(int num1, int num2) {
		if(num1 > num2){
			int t = num1;
			num1 = num2;
			num2 = t;
		}
		while(num1 != 0){
			int tmp = num2 % num1;
			num2 = num1;
			num1 = tmp;
		}
		return num2 ;
	}
}
